<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>192 【例8-2】demo02.html</title>
</head>

<body>
    <div id="mouse"></div>
    <script>
        var mouse = document.getElementById('mouse');
        document.onclick = function (event) {
            var event = event || window.event;
            var pageX = event.pageX || event.clientX + document.documentElement.scrollLeft;
            var pageY = event.pageY || event.clientY + document.documentElement.scrollTop;
            var targetX = pageX - mouse.offsetWidth / 2;
            var targetY = pageY - mouse.offsetHeight / 2;
            mouse.style.display = 'block';
            mouse.style.left = targetX + 'px';
            mouse.style.top = targetY + 'px';
        };
    </script>
    <a href="../首页/page08.html">
        <h2>返回上一页面</h2>
    </a>
</body>

</html>